#define _CRT_SECURE_NO_WARNINGS 1
int findPeakElement(int* nums, int numsLen) {
    int left = 0, right = numsLen - 1;
    while (left < right)
    {
        int mid = (left + right) / 2;
        if (nums[mid] > nums[right])
        {
            right = mid;
        }
        else {
            left = mid + 1;
        }
    }
    return left;
}